var CryptoJS = require('crypto-js');


function _0x11dbad() {
    for (var _0x55977e = [], _0x12474f = '0123456789abcdef', _0x33c6e8 = 0x0; _0x33c6e8 < 0x24; _0x33c6e8++)
        _0x55977e[_0x33c6e8] = _0x12474f['substr'](Math['floor'](0x10 * Math['random']()), 0x1);
    return _0x55977e[14] = '4',
        _0x55977e[0x13] = _0x12474f['substr'](0x3 & _0x55977e[0x13] | 0x8, 0x1),
        _0x55977e[0x8] = _0x55977e[0xd] = _0x55977e[0x12] = _0x55977e[0x17] = '-',
        _0x55977e['join']('');
}

var captchaId = 'qDG21VMg9qS5Rcok4cfpnHGnpf5LhcAv'
var ts = Date.now()
var captchaKey = CryptoJS.MD5(ts + _0x11dbad())
var type = 'slide'
var token = CryptoJS.MD5(ts + captchaId + type + captchaKey) + ':' + (parseInt(ts) + 300000)
var referer = 'https://v8.chaoxing.com/'
var version = '1.1.20'
var iv = CryptoJS.MD5(captchaId + type + Date.now() + _0x11dbad())

function get_img_request() {
    return `callback=cx_captcha_function&captchaId=${captchaId}&type=slide&version=1.1.20&captchaKey=${captchaKey}&token=${token}&referer=${referer}&iv=${iv}&_=${Date.now()}`
}

function get_img_result(token,offset){
    return `callback=cx_captcha_function&captchaId=qDG21VMg9qS5Rcok4cfpnHGnpf5LhcAv&type=slide&token=${token}&textClickArr=%5B%7B%22x%22%3A${offset}%7D%5D&coordinate=%5B%5D&runEnv=10&version=1.1.20&t=a&iv=${iv}&_=${Date.now()}`
}



